/**
 * 
 */
package com.googlecode.pcapj.bridj;

import org.bridj.Pointer;
import org.bridj.StructObject;
import org.bridj.ann.Array;
import org.bridj.ann.Field;

/**
 * 
struct sockaddr_in {
    short   sin_family;
    u_short sin_port;
    struct  in_addr sin_addr;
    char    sin_zero[8];
};
 

 * 
 */
public class sockaddr_in extends StructObject {
    public sockaddr_in() { super(); }
    public sockaddr_in(Pointer<? extends StructObject> pointer) { super(pointer); }

    /**
     * @return
     */
    @Field(0) 
    public short sin_family() {
            return this.io.getShortField(this, 0);
    }
    /**
     * @param sin_family
     * @return
     */
    @Field(0) 
    public sockaddr_in sin_family(byte sin_family) {
            this.io.setShortField(this, 0, sin_family);
            return this;
    }
    /**
     * @return
     */
    @Field(1) 
    public short sin_port() {
            return this.io.getShortField(this, 1);
    }
    @Field(1) 
    public sockaddr_in sin_port(short sin_port) {
            this.io.setShortField(this, 1, sin_port);
            return this;
    }
    
    /**
     * @return
     */
    @Field(2) 
    public in_addr sin_addr() {
            return this.io.getNativeObjectField(this, 2);
    }
    @Field(2) 
    public sockaddr_in sin_addr(in_addr sin_addr) {
            this.io.setNativeObjectField(this, 2, sin_addr);
            return this;
    }
    /**
     * @return
     */
    @Array({8})
    @Field(3) 
    public Pointer<Byte> sin_zero() {
            return this.io.getPointerField(this, 3);
    }
}
